function buildName(firstName:string, lastName:string){
    if(lastName){
        return firstName+" "+lastName;
    }else{
        return firstName;
    }
}
let name1=buildName("tom","jackson");

function buildName2(firstName:string, lastName?:string){
    if(lastName){
        return firstName+" "+lastName;
    }else{
        return firstName;
    }
}
let name2=buildName2("tom");

function buildName3(firstName:string, ...restOfNames:string[]){
    return firstName+" "+restOfNames.join(" ");
}
let studentName=buildName3("tom","souye","mygod","shit");